package com.example.lib;

public class MyMainClass {
     public static void main(String[] args) {
        Duck duck = new ReadHeadDuck();
        duck.display();
        duck.performFly();
        duck.performQuack();

        //改变飞行行为，不能飞了
         duck.setFlyBehavior(new FlyNoWay());
         duck.performFly();
    }
}